package string;
import java.lang.StringBuilder;
import com.sun.org.apache.xpath.internal.objects.XString;

public class StringAndStringBuilderDemo {
    public static void main(String[] args) {
       /** String str = "a";
        for (int i = 0; i <=1000000 ; i++) {
            str =str+ "a";
        }
        System.out.println("执行完毕");
        */
        StringBuilder builder = new StringBuilder("a");
        for (int i = 0; i < 1000000; i++) {
            builder.append("a");
        }
        System.out.println("执行完毕");
        StringBuilder stringBuilder = new StringBuilder("aaabbbcccAAA");
        stringBuilder.append("BBB").append("CCC");
        System.out.println(stringBuilder);
        System.out.println(stringBuilder.delete(9,18));
        System.out.println( stringBuilder.replace(9,17,"EEEFFFGGG"));
        System.out.println(stringBuilder.insert(0,"111"));
        System.out.println(stringBuilder.reverse());
    }

}
